# 把相同天数需要的资源放在一起，比较 m 和 资源数
from collections import defaultdict
n, m, k = map(int,input().strip().split())
data = defaultdict(int)  # 默认值为 0
max_day = 0
# 读取输入数据
for i in range(int(n)):
    day, s = map(int,input().strip().split())
    data[day] += s
    max_day = max(max_day, day)
for i in range(max_day,k-1,-1):
    if m > data[i]:
        if i == k:
            print(k)
            break
        m -= data[i]
        data[i-1] += data[i]
    else:
        print(i)
        break
